package com.fluidops.datacatalog.reltables.sim.entity;

import java.util.Collection;

import com.fluidops.datacatalog.reltables.model.Entity;

public class UniformWeight implements IEntitySimilarity{

	public UniformWeight(){}
	
	@Override
	public double calcEntitySimilarity(Entity e1, Entity e2) {
		Collection<String> labels1 = e1.getLabels();
		Collection<String> labels2 = e2.getLabels();
		
		int similarity = 0;
		for(String l1 : labels1){
			if(labels2.contains(l1)){
				similarity++;
			}
		}
		
		return similarity;
	}

}
